Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Event
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1028 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 96.01% 96.02% +0.01%
==========================================
Files 185 185 —
Lines 25757 25805 +48
Branches 0 0 —
==========================================
+ Hits 24729 24777 +48
- Misses 1028 1028 —
- Partials 0 0 —Generated by Codecov Action |
8d774b2 to
50b0c0f
Compare
50b0c0f to
9e4e6f4
Compare
9e4e6f4 to
7eabcd6
Compare
7eabcd6 to
31b6003
Compare
31b6003 to
e148c0a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…tions Move setOrgProjectContext() from individual command files into the shared resolution functions in resolve-target.ts, trace-target.ts, and dashboard/resolve.ts. This ensures every command that resolves an org or project automatically gets sentry.org and sentry.project telemetry tags, eliminating the class of bugs where a command forgets to call setContext(). Previously ~15 commands manually called this.setContext() after resolution, while ~15 others (all dashboard/*, event/view, project/*, trial/*, org/view) forgot — causing missing telemetry tags on error events. Changes: - Add setOrgProjectContext calls to 6 functions in resolve-target.ts - Add setOrgProjectContext calls to 2 functions in trace-target.ts - Add setOrgProjectContext call to resolveOrgFromTarget in dashboard/resolve.ts - Remove setContext from SentryContext interface and buildContext - Remove all manual setContext calls from 12 command files - Update 35 test files to remove setContext from mock contexts - Delete 7 test blocks that asserted setContext was called
e148c0a to
ba22c39
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follows up on #534 which added
setContexttoissue explainandissue plan. Rather than playing whack-a-mole with individual commands,this moves
setOrgProjectContext()into the shared resolution functionsthat every command already calls.
Problem
~15 commands manually called
this.setContext()after resolution, while~15 others (all dashboard/*, event/view, project/*, trial/*, org/view)
forgot — causing missing
sentry.org/sentry.projecttags on errorevents for those commands.
Solution
Add
setOrgProjectContext()calls to the 4 resolution layers:resolve-target.ts— 6 functions (resolveOrgAndProject,resolveOrg,resolveAllTargets,resolveOrgProjectTarget,resolveProjectBySlug,resolveOrgsForListing)trace-target.ts— 2 functions (resolveTraceOrgProject,resolveTraceOrg)dashboard/resolve.ts—resolveOrgFromTargetThen remove
setContextfromSentryContextinterface and all 12command files that called it manually.
Stats
50 files changed, +85 −350 (net −265 lines)